:root {
    --primary: #4361ee;
    --secondary: #4895ef;
    --danger: #e63946;
    --success: #2a9d8f;
    --light: #f8f9fa;
    --dark: #212529;
    --gray: #6c757d;
    --light-gray: #e9ecef;
    --border-radius: 8px;
    --shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    --transition: all 0.3s ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: var(--dark);
    background-color: #f5f7fb;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

.header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 1rem;
    color: var(--primary);
}

.main-content {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2rem;
}

@media (min-width: 768px) {
    .main-content {
        grid-template-columns: 1fr 2fr;
    }
}

.card {
    background: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    transition: var(--transition);
}

.card:hover {
    box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
}

.book-form h2, .book-list h2 {
    margin-bottom: 1.5rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--light-gray);
}

.form-group {
    margin-bottom: 1.2rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid var(--light-gray);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition);
}

input:focus {
    border-color: var(--primary);
    outline: none;
    box-shadow: 0 0 0 3px rgba(67, 97, 238, 0.25);
}

.form-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1.5rem;
}

.btn {
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn.primary {
    background-color: var(--primary);
    color: white;
}

.btn.secondary {
    background-color: var(--gray);
    color: white;
}

.btn.danger {
    background-color: var(--danger);
    color: white;
}

.btn.success {
    background-color: var(--success);
    color: white;
}

.btn:hover {
    opacity: 0.9;
    transform: translateY(-2px);
}

.btn:active {
    transform: translateY(0);
}

.icon-btn {
    padding: 0.5rem;
}

.hidden {
    display: none !important;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

#bookTableWrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th, td {
    padding: 1rem;
    text-align: left;
    border-bottom: 1px solid var(--light-gray);
}

th {
    background-color: var(--light);
    font-weight: 600;
}

tr:hover {
    background-color: rgba(67, 97, 238, 0.05);
}

.action-buttons {
    display: flex;
    gap: 0.5rem;
}

.footer {
    text-align: center;
    margin-top: 3rem;
    padding: 1rem;
    color: var(--gray);
    font-size: 0.9rem;
}

.loading {
    text-align: center;
    padding: 2rem;
    color: var(--gray);
}

.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 2rem;
    border-radius: var(--border-radius);
    color: white;
    box-shadow: var(--shadow);
    z-index: 1000;
    transform: translateX(200%);
    transition: transform 0.3s ease;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: var(--success);
}

.toast.error {
    background-color: var(--danger);
}